//package com.juben.svr.service.impl;
//
//
//
//
////import org.apache.pdfbox.pdmodel.PDDocument;
//
//import org.springframework.stereotype.Service;
//
//import java.io.*;
//import java.nio.file.Paths;
//import java.util.UUID;
//
//
////import com.itextpdf.kernel.pdf.PdfDocument;
////import com.itextpdf.kernel.pdf.PdfWriter;
////import com.itextpdf.layout.Document;
////import org.springframework.stereotype.Service;
//
//
//import java.io.FileOutputStream;
//
//@Service
//public class PdfServiceimpl {
//
//    // 指定 PDF 文件保存的文件夹路径
//    private final String directoryPath = "D:\\学习资料\\毕业设计\\pdfs";
//    public ByteArrayInputStream generatePdf(String content) throws IOException {
//        PDDocument document = new PDDocument();
//        PDPage page = new PDPage();
//        document.addPage(page);
//
//        try (PDPageContentStream contentStream = new PDPageContentStream(document, page)) {
//            contentStream.beginText();
//            contentStream.setFont(PDType1Font.TIMES_ROMAN, 12);
//            contentStream.newLineAtOffset(25, 700);
//            contentStream.showText(content);
//            contentStream.endText();
//        }
//
//        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
//        document.save(byteArrayOutputStream);
//        document.close();
//        return new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
//    }
//
//
//}
